{% extends "base.volt" %}

        {% block pageHeader %}
        {{ stylesheet_link("/libs/bootstrap-daterangepicker/daterangepicker.css", false) }}
        {% endblock %}

{% block pageFooter%}
    {{ javascript_include("/js/area.js", false) }}
    {{ javascript_include("/libs/bootstrap-daterangepicker/moment.min.js", false) }}
    {{ javascript_include("/libs/bootstrap-daterangepicker/daterangepicker.js", false) }}

    {{ javascript_include("/libs/UEditor/utf8-php/ueditor.config.js", false) }}
    {{ javascript_include("/libs/UEditor/utf8-php/ueditor.all.min.js", false) }}
    {{ javascript_include("/libs/UEditor/utf8-php/lang/zh-cn/zh-cn.js", false) }}
    {{ javascript_include("/assets/manage/js/bp/add.js", false) }}
{% endblock %}

{% block content %}
{{ partial("module/left_bp") }}

<div class="col-xs-10">
    <ol class="breadcrumb">
        <li><a href="{{ url.get('bp/list')  }}">美容院</a></li>
        <li><a href="{{ url.get('bp/list')  }}">美容院管理</a></li>
        <li class="active">添加美容院</li>
        <li class="active">基础信息</li>
    </ol>
    <form id="form_add" class="form-horizontal" role="form" method="post" action="" target="ifr_send_file" enctype="multipart/form-data" urlAddService="{{ url.get('bpservice/add') }}" urlList="{{ url.get('bp/list') }}">
        <div class="form-group">
            <label for="bp_name" class="col-xs-2 control-label">名称</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" id="bp_name" name="bp_name" data-rule="required;length[~20]">
            </div>
        </div>
        <div class="form-group">
            <label for="bp_cover" class="col-xs-2 control-label">封面</label>
            <div class="col-xs-9">
                <input type="file" class="form-control" id="bp_cover" name="bp_cover" data-rule="required;">
                <p class="help-block">*支持JPG，PNG，JPEG格式的图片，大小不超过1M，尺寸为：270X270px</p>
            </div>
        </div>
        <div class="form-group">
            <label for="bp_district" class="col-xs-2 control-label">城市</label>
            <div class="form-inline col-xs-9">
                <div class="input-group">
                    <label class="input-group-addon">省</label>
                    <select class="form-control" id="bp_province">
                        <option value="">请选择...</option>
                    </select>
                    <label class="input-group-addon">市</label>
                    <select class="form-control" id="bp_city">
                        <option value="">请选择...</option>
                    </select>
                    <label class="input-group-addon">区/县</label>
                    <select class="form-control" name="bp_district" id="bp_district" data-rule="required(not, -10000);" data-target="#bp_district_error">
                        <option value="-10000">请选择...</option>
                    </select>
                </div>
                <div class="input-group" id="bp_district_error"></div>
            </div>
        </div>
        <div class="form-group">
            <label for="bp_address" class="col-xs-2 control-label">地址</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" id="bp_address" name="bp_address" data-rule="required;length[~50]">
            </div>
        </div>
        <div class="form-group">
            <label for="bp_coordinate" class="col-xs-2 control-label">地理坐标</label>
            <div class="form-inline col-xs-9">
                <div class="input-group paddingTB5">
                    <input type="text" class="form-control" id="bp_coordinate" name="bp_coordinate" readonly="readonly" data-rule="required;" data-target="#bp_coordinate_error">
                    <div class="input-group-addon bg_337ab7 cursor_pointer" id="but_map_select" durl="{{ url.get('tools/map') }}"><i class="fa fa-map-marker"></i> 选择...</div>
                </div>
                <div class="input-group" id="bp_coordinate_error"></div>
            </div>
        </div>
        <div class="form-group">
            <label for="bp_tel" class="col-xs-2 control-label">电话</label>
            <div class="col-xs-3">
                <input type="text" class="form-control" id="bp_tel" name="bp_tel" data-rule="required;tel|mobile">
            </div>
        </div>
        <div class="form-group">
            <label for="bp_is_sell" class="col-xs-2 control-label">是否销售</label>
            <div class="col-xs-9">
                <div class="radio">
                    <label>
                        <input type="radio" name="bp_is_sell" id="bp_is_sell_1" value="1" checked="checked"> 是
                    </label>
                    <label>
                        <input type="radio" name="bp_is_sell" id="bp_is_sell_0" value="0"> 否
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label for="bp_is_sell" class="col-xs-2 control-label">勋章</label>
            <div class="col-xs-9">
                <div class="checkbox">
                    <!-- <label>
                        <input type="checkbox" name="bp_medal_refund" id="bp_medal_refund" value="1"> 退款保障
                    </label> -->
                    <label>
                        <input type="checkbox" name="bp_medal_verify" id="bp_medal_verify" value="1"> 深度验店 
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label for="low_price" class="col-xs-2 control-label">起步价</label>
            <div class="col-xs-3">
                <div class="input-group">
                    <input type="text" class="form-control" id="low_price" name="low_price" data-rule="required;decimal" data-target="#bq_price_error">
                    <div class="input-group-addon">元起</div>
                </div>
            </div>
            <div id="bq_price_error"></div>

        </div>
        <div class="form-group">
            <label for="open_year" class="col-xs-2 control-label">开业年限</label>
            <div class="col-xs-3">
                <div class="input-group">
                    <input type="text" class="form-control" id="open_year" name="open_year" data-rule="required;integer[+0]" data-target="#bq_year_error">
                    <div class="input-group-addon">年</div>
                </div>
            </div>
            <div id="bq_year_error"></div>

        </div>
        <div class="form-group">
            <label for="shop_area" class="col-xs-2 control-label">店铺面积</label>
            <div class="col-xs-3">
                <div class="input-group">
                    <input type="text" class="form-control" id="shop_area" name="shop_area" style="" data-rule="required;integer[+0]" data-target="#bq_area_error">
                    <div class="input-group-addon"> m²</div>
                </div>
            </div>

            <div id="bq_area_error"></div>

        </div>
        <div class="form-group">
            <label for="shop_area" class="col-xs-2 control-label">项目</label>
            <div class="col-xs-3">
                <div class="input-group">
                    <input type="text" class="form-control" id="service_num" name="service_num" data-rule="required;integer[+0]" data-target="#bq_xm_error">
                    <div class="input-group-addon"> 项</div>
                </div>
            </div>

            <div id="bq_xm_error"></div>

        </div>
        <div class="form-group">
            <label for="shop_area" class="col-xs-2 control-label">设备设施</label>
            <div class="col-xs-9 form-inline">
                <div id="checks">
                    <label class="checkbox-inline">
                        <input type="checkbox" name="facilities[]" value="wifi" > WIFI
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="facilities[]" value="停车"> 停车
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="facilities[]" value="洗浴"> 洗浴
                    </label>
                </div>

                <div id="delBox" class="paddingTB5"></div>
                <div class="input-group paddingTB5">
                    <input type="text" class="form-control" id="add_equipmentText" name="" data-rule="length[~16]" data-target="#bq_tag_error">
                    <div class="input-group-addon bg_337ab7 cursor_pointer" id="add_equipment" ><i class="fa fa-plus"></i> 添加</div>
                </div>
                <div id="bq_tag_error"></div>

            </div>
        </div>
        <div class="form-group">
            <label for="time" class="col-xs-2 control-label">营业时间</label>
            <div class="col-xs-3">
                <input type="text" class="form-control" id="time" name="time" data-rule="required;">
            </div>
        </div>
        <div class="form-group">
            <label for="bp_tags" class="col-xs-2 control-label">标签</label>
            <input type="hidden" name="bp_tags" id="bp_tags">
            <div class="form-inline col-xs-7">
                <div class="input-group">
                    <input type="text" class="form-control" id="bp_tags_view" readonly="readonly" data-rule="required;" data-target="#bp_tags_error">
                    <div class="input-group-addon bg_337ab7 cursor_pointer" id="but_tags_select" durl="{{ url.get('bptag/layer') }}"><i class="fa fa-tag"></i> 选择...</div>
                </div>
                <div class="input-group" id="bp_tags_error"></div>
            </div>
        </div>
        <div class="form-group">
            <label for="bp_photos" class="col-xs-2 control-label">轮播图片</label>
            <div class="col-xs-9">
                <div id="bp_photos_box">
                    <div class="input-group paddingTB5">
                        <input type="file" class="form-control" name="bp_photos[]">
                        <div class="input-group-addon bg_red cursor_pointer" onclick="$.bpPhotoDel(this)"><i class="fa fa-times"></i></div>
                    </div>
                    <div class="input-group paddingTB5">
                        <input type="file" class="form-control" name="bp_photos[]">
                        <div class="input-group-addon bg_red cursor_pointer" onclick="$.bpPhotoDel(this)"><i class="fa fa-times"></i></div>
                    </div>
                </div>
                <div>
                    <p class="help-block pull-left">*支持JPG，PNG，JPEG格式的图片，大小不超过1M，尺寸为：750X350px</p>
                    <button type="button" id="but_add_photo" class="btn btn-primary btn-sm pull-right"><i class="fa fa-plus"></i></button>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label for="bp_owner_mobile" class="col-xs-2 control-label">店长电话</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" id="bp_owner_mobile" name="bp_owner_mobile" data-rule="mobile;">
            </div>
        </div>
        <div class="form-group">
            <label for="bp_is_sell" class="col-xs-2 control-label">介绍</label>
            <div class="col-xs-9">
                 <textarea id="editor" name="bp_intro" id="bp_intro" rows="15" style="height:300px;" data-rule="required;">{{ bpInfo.bp_intro|e }}</textarea>
            </div>
        </div>
        <?php if($branch_id!=''){?>
        <div class="form-group">
            <label for="bp_is_sell" class="col-xs-2 control-label">分店ID</label>
            <div class="col-xs-9">
                <?=$branch_id?>
                <input type="hidden" name="branch" value="<?=$branch_id?>">
            </div>
        </div>
        <?php }?>

        <div class="form-group">
            <div class="col-xs-12 text-center">
                <button type="submit" class="btn btn-primary"><i class="fa fa-floppy-o fa-lg"></i> 保 存</button>
            </div>
        </div>
    </form>
</div>


{% endblock %}
